package homework12月9号补交.homework2.d13;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class demo1 {
    public static void main(String[] args) throws IOException {
        HashMap<String, String> map = new HashMap<>();
        map.put("pid","10");
        map.put("name","张三");
        map.put("age","18");
        for (Map.Entry<String, String> s : map.entrySet()) {
            FileUtils.writeStringToFile(new File("D:\\ldea dashuju\\day.12.6\\src\\czxy\\homework2\\d13\\mapdata.properties"),s.getKey()+",",true);
            FileUtils.writeStringToFile(new File("D:\\ldea dashuju\\day.12.6\\src\\czxy\\homework2\\d13\\mapdata.properties"),s.getValue()+"\n",true);
        }
    }
}
